package com.mornd.gulimall.apis.member.to;

import com.mornd.gulimall.common.core.constant.RegexpConstant;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * @author: mornd
 * @dateTime: 2023/8/18 - 9:02
 */

@Getter
@Setter
public class MemberRegistTo {
    @NotBlank(message = "用户名不能为空")
    @Size(min = 3, max = 10, message = "用户名长度须在{min}-{max}之间")
    private String username;

    @NotBlank(message = "密码不能为空")
    @Size(min = 6, max = 20, message = "密码长度须在{min}-{max}之间")
    private String password;

    @NotBlank(message = "手机号不能为空")
    // 用于匹配以非零开头的 11 位数字
    @Pattern(regexp = RegexpConstant.PHONE, message = "手机号格式不正确")
    private String phone;

    //@NotBlank
    private String code;
}
